//
//  NSString+PinYin.m
//  HuiZhiMin
//
//  Created by Seymour on 16/9/19.
//  Copyright © 2016年 胡钢祥. All rights reserved.
//

#import "NSString+PinYin.h"

@implementation NSString (PinYin)
+ (NSString *)transform:(NSString *)chinese{
    NSMutableString *pinyin = [chinese mutableCopy];
    CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformMandarinLatin, NO);
    CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformStripCombiningMarks, NO);
    //    NSLog(@"%@", pinyin);
    return [pinyin stringByReplacingOccurrencesOfString:@" " withString:@""];
}
@end
